bitkeeper revision 1.1159.258.9 (421d978cixdcn2ycn94dJci5cqGzjg)
authorkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Thu, 24 Feb 2005 08:59:56 +0000 (08:59 +0000)
committerkaf24@scramble.cl.cam.ac.uk <kaf24@scramble.cl.cam.ac.uk>
Thu, 24 Feb 2005 08:59:56 +0000 (08:59 +0000)
Build cleanups. Build dynamic libs as -fPIC always.
Signed-off-by: Keir Fraser <keir.fraser@cl.cam.ac.uk>
tools/Makefile
tools/Rules.mk
tools/libxc/Makefile
tools/libxutil/Makefile
tools/misc/miniterm/Makefile
xen/Makefile

index 907260707bda775bb4697bfcab48d3f6ce993dfd..0140f8baae3890040abab7f3bff0eff6aba1a797 100644 (file)
@@ -21,6 +21,7 @@ install:
        $(MAKE) -C sv install
 
 clean:
+       $(MAKE) -C check clean
        $(MAKE) -C libxutil clean
        $(MAKE) -C libxc clean
        $(MAKE) -C misc clean
index 2666f438425dc21666fea98da47edfd9ac80bbc5..eb89b3be05c7b98a2f425357baab3caca993c161 100644 (file)
@@ -4,6 +4,9 @@ XEN_XC             = $(XEN_ROOT)/tools/python/xen/lowlevel/xc
 XEN_LIBXC          = $(XEN_ROOT)/tools/libxc
 XEN_LIBXUTIL       = $(XEN_ROOT)/tools/libxutil
 
+COMPILE_ARCH    ?= $(shell uname -m | sed -e s/i.86/x86_32/)
+TARGET_ARCH     ?= $(COMPILE_ARCH)
+
 ifeq ($(TARGET_ARCH),x86_32)
 CFLAGS  += -m32 -march=i686
 LDFLAGS += -m elf_i386
@@ -13,3 +16,9 @@ ifeq ($(TARGET_ARCH),x86_64)
 CFLAGS  += -m64
 LDFLAGS += -m elf_x86_64
 endif
+
+%.opic: %.c
+       $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
+
+%.o: %.c
+       $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
index 770b40032683c200920a48fc6ac9766a7be94260..01fd926cf447d9d2e06127f775a4e2c992225d5b 100644 (file)
@@ -1,12 +1,4 @@
 
-ifndef BUILD_PIC_LIBS
-ifeq ($(wildcard /etc/debian_version),)
-BUILD_PIC_LIBS=n
-else
-BUILD_PIC_LIBS=y
-endif
-endif
-
 INSTALL                = install
 INSTALL_PROG   = $(INSTALL) -m0755
 INSTALL_DATA   = $(INSTALL) -m0644
@@ -95,9 +87,6 @@ rpm: all
        mv staging/i386/*.rpm .
        rm -rf staging
 
-$(PIC_OBJS): %.opic: %.c
-       $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
-
 libxc.a: $(OBJS)
        $(AR) rc $@ $^
 
@@ -106,12 +95,7 @@ libxc.so: libxc.so.$(MAJOR)
 libxc.so.$(MAJOR): libxc.so.$(MAJOR).$(MINOR)
        ln -sf $< $@
 
-ifeq ($(BUILD_PIC_LIBS),y)
 libxc.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
        $(CC) -Wl,-soname -Wl,libxc.so.$(MAJOR) -shared -o $@ $^ -L../libxutil -lxutil -lz
-else
-libxc.so.$(MAJOR).$(MINOR): $(LIB_OBJS)
-       $(CC) -Wl,-soname -Wl,libxc.so.$(MAJOR) -shared -o $@ $^ -L../libxutil -lxutil -lz
-endif
 
 -include $(DEPS)
index 595cd97e83a54e650f5c723e27723a874f15eefb..a9be3e3977cdb67e993d121b64f91cc2c9238b1a 100644 (file)
@@ -1,12 +1,4 @@
 
-ifndef BUILD_PIC_LIBS
-ifeq ($(wildcard /etc/debian_version),)
-BUILD_PIC_LIBS=n
-else
-BUILD_PIC_LIBS=y
-endif
-endif
-
 XEN_ROOT = ../..
 INSTALL                = install
 INSTALL_DATA   = $(INSTALL) -m0644
@@ -51,22 +43,14 @@ LIB      += libxutil.a
 all: check-for-zlib
        $(MAKE) $(LIB)
 
-$(PIC_OBJS): %.opic: %.c
-       $(CC) $(CPPFLAGS) -DPIC $(CFLAGS) -fPIC -c -o $@ $<
-
 libxutil.so: libxutil.so.$(MAJOR)
        ln -sf $^ $@
 
 libxutil.so.$(MAJOR): libxutil.so.$(MAJOR).$(MINOR)
        ln -sf $^ $@
 
-ifeq ($(BUILD_PIC_LIBS),y)
 libxutil.so.$(MAJOR).$(MINOR): $(PIC_OBJS)
        $(CC) -Wl,-soname -Wl,libxutil.so.$(MAJOR) -shared -o $@ $^
-else
-libxutil.so.$(MAJOR).$(MINOR): $(LIB_OBJS)
-       $(CC) -Wl,-soname -Wl,libxutil.so.$(MAJOR) -shared -o $@ $^
-endif
 
 libxutil.a: $(LIB_OBJS)
        $(AR) rc $@ $^
index 4051eb61de62fc71d0e6f1973bb4b32121083a5f..a9ae844e843c7f7722d76283df0106635bbaadb4 100644 (file)
@@ -14,3 +14,6 @@ install: all
 
 clean:
        $(RM) *.o $(TARGET) *~
+
+$(TARGET): $(TARGET).c
+       $(CC) $(CFLAGS) -o $@ $<
index 57a89ad454b6f2e3ee9abebad99cf986260f8e95..27b5c2e239735088d25e9b8b74eee2021734a5de 100644 (file)
@@ -37,12 +37,12 @@ install: $(TARGET).gz
        $(INSTALL_DATA) include/public/io/*.h $(DESTDIR)/usr/include/xen/io
        $(INSTALL_DATA) include/public/COPYING $(DESTDIR)/usr/include/xen
 
-clean:
+clean: delete-unfresh-files
        $(MAKE) -C tools clean
        $(MAKE) -C common clean
        $(MAKE) -C drivers clean
        $(MAKE) -C arch/$(TARGET_ARCH) clean
-       rm -f include/asm *.o $(TARGET)* *~ core include/xen/compile.h
+       rm -f include/asm *.o $(TARGET)* *~ core
        rm -f include/asm-*/asm-offsets.h
        rm -f tools/figlet/*.o tools/figlet/figlet